import { ADD_ARTICLE, CHANG_ROUTER } from "../action/action-type"
import { combineReducers } from "redux";

function articles(state = [], action) {
  switch (action.type) {
    case ADD_ARTICLE:
      return state.concat(action.payload)
    default:
      return state
  }
};

function routerIndex(state, action) {
  switch (action.type) {
    case CHANG_ROUTER:
      return [action.payload]
    default:
      return ['1']
  }
}


export default combineReducers({
  articles,
  routerIndex
})